package top.revery.api.api.user;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import top.revery.api.config.UserPageData;

import top.revery.api.entity.user.BaseCompanyUser;


import java.util.List;
import java.util.Map;


/**
 * @author denghao
 * @title
 * @package  企业
 * @date 2019/12/13 16:48
 */
@RequestMapping("/api_company")
public interface ICompanyApi{
    //保存企业
    @PostMapping("/save")
    BaseCompanyUser save(@RequestBody BaseCompanyUser baseCompanyUser);

    //修改企业
    @PostMapping("/update")
    void update(@RequestBody BaseCompanyUser baseCompanyUser, @RequestParam(value = "id") Long id) throws Exception;

    //分页多条件查询所有
    @PostMapping("/getList")
    UserPageData getList(@RequestParam(value = "pageNum") int pageNum, @RequestParam(value = "pageSize")int pageSize,
                         @RequestBody Map map);

    //根据id查询
    @PostMapping("/findById")
    BaseCompanyUser findById(@RequestParam(value = "id") Long id);
    //根据名字模糊查询
    @PostMapping("/findByName")
    List<BaseCompanyUser>  findByName(@RequestParam(value = "name") String name);

}
